<?php
/**
 * @Author:  Groube
 * @Date:    2017-03-08 15:50:00
 * @version  $Id$
 */

class ZhuyuanTizhengModel extends BaseModel {

    //返回给终端的可执行sql语句的字段名称数组
    public $_field_arr = [
                            'id',
                            'patient_id',
                            'zhuyuan_id',
                            'jiancha_time',
                            'jiancha_doctor_name',
                            'jiancha_doctor_id',
                            'jiancha_type',
                            'jiancha_danwei',
                            'jiancha_value',
                            'jiancha_fangshi',
                            'beizhu',
                            'jiancha_shijian_duan',
                            'batch_id',
                            'input_type',
                            'data_source',
                            'biaodan_type'
                          ];


    public function ls($zhuyuan_tizheng,$zhuayun_bingren,$yiyuan_id){
        $field_str = 'id,patient_id,zhuyuan_id,jiancha_time,jiancha_doctor_name,jiancha_doctor_id,jiancha_type,jiancha_danwei,jiancha_value,jiancha_fangshi,beizhu,jiancha_shijian_duan,batch_id,input_type,data_source,biaodan_type';
        $query = DB::select($field_str)->from($zhuyuan_tizheng)
            ->where('zhuyuan_id','IN',$zhuayun_bingren)
            ->where('yiyuan_id','=',$yiyuan_id)
            ->where('state','=','1')
            ->execute()
            ->as_array();

        return $query;
    }
}
